<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>连续签到配置</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<shiro:hasPermission name="sys:user:edit"><li ><a href="${ctx}/wechat/signupConfig/">连续签到列表</a></li></shiro:hasPermission>
		<li class="active"><a href="${ctx}/wechat/signupConfig/form?id=${signupConfig.id}">连续签到配置<shiro:hasPermission name="wechat:signupConfig:edit">${not empty signupConfig.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="wechat:signupConfig:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="signupConfig" action="${ctx}/wechat/signupConfig/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<form:hidden path="user.id"/>
		
		<tags:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">签到周期:</label>
			<div class="controls">
				<form:input path="dayNumber" htmlEscape="false" maxlength="50" class="required number"/><span class="alert">设定签到周期的天数</span>
			</div>
		</div>
		
		
		<div class="control-group">
			<label class="control-label">签到递增的分值:</label>
			<div class="controls">
				<input name="pScore" class="required number" type="text" htmlEscape="false" value="<fmt:formatNumber value='${signupConfig.score/1000}' pattern='###.###'  minFractionDigits='3'/>">
				<label style="color:grey"><span class="alert">（元）精确到小数点后三位 </span><span class="alert">每完成一个签到周期规则后，在原有分值奖励基础上给会员奖励的值</span></label>
				<%-- <form:input path="score" htmlEscape="false" class="required number"/> --%>
				
				<!-- <label style="color:grey"><span class="alert">积分以“<span style="color:red;">厘</span>”为单位</span></label> -->
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">签到获得的最大分值:</label>
			<div class="controls">
				<input name="pMaxScore" class="required number" type="text" htmlEscape="false" value="<fmt:formatNumber value='${signupConfig.maxScore/1000}' pattern='###.###'  minFractionDigits='3'/>">
				<label style="color:grey"><span class="alert">（元）精确到小数点后三位 </span><span class="alert">连续签到分值奖励的最大值，如分值没有封顶填入0</span></label>
				
				<%-- <form:input path="maxScore" htmlEscape="false"   class="required number"/> --%>
				
				<!-- <label style="color:grey"><span class="alert">积分以“<span style="color:red;">厘</span>”为单位</span></label> -->
				
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">循环周期:</label>
			<div class="controls">
				<form:input path="cycle" htmlEscape="false"   class="required number" /><span class="alert">连续签到满足一个周期，签到天数自动归0，会员重新签到，如不需要改功能填入0</span>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">是否开启:</label>
			<div class="controls">
					<input type="radio" ${signupConfig.startup?'checked="checked"':"" }  value="true" name="startup">
					是
					<input type="radio" ${signupConfig.startup?"":'checked="checked"' } value="false" name="startup">
					否
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">备注:</label>
			<div class="controls">
				<form:input path="remarks" htmlEscape="false" maxlength="50" />
			</div> 
		</div>
		
		
		<div class="form-actions">
			<shiro:hasPermission name="wechat:signupConfig:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>
